package data

import (
	"context"
	v1 "gitlab.cqcb.com/shangyou_mic/dscm-approve-api-pb/api/roses/v1"

	"rosesbff/internal/biz"
	"rosesbff/internal/data/redis"
)

type Account struct {
	account v1.AccountClient
	redis   *redis.Redis
}

func NewAccount(
	grpcClient *GRPCClient,
	redis *redis.Redis,
) (biz.AccountRepo, error) {
	return &Account{
		account: v1.NewAccountClient(grpcClient.account),
		redis:   redis,
	}, nil
}

func (s *Account) ServerGetUser(ctx context.Context, req *v1.FxUser) (*v1.FxUser, error) {
	return s.account.ServerGetUser(ctx, req)
}

func (s *Account) ServerSaveUser(ctx context.Context, req *v1.FxUser) (*v1.FxUser, error) {
	return s.account.ServerSaveUser(ctx, req)
}

func (s *Account) ServerSystemRole(ctx context.Context, req *v1.ServerSystemRoleRequest) (*v1.ServerSystemRoleReply, error) {
	return s.account.ServerSystemRole(ctx, req)
}

func (s *Account) ServerGetUserPermitLists(ctx context.Context, req *v1.FxUser) (*v1.UserPermit, error) {
	return s.account.ServerGetUserPermitLists(ctx, req)
}

func (s *Account) CreateAccount(ctx context.Context, req *v1.CreateAccountRequest) (*v1.CreateAccountReply, error) {
	return s.account.CreateAccount(ctx, req)
}

func (s *Account) GetAccountInfo(ctx context.Context, req *v1.GetAccountInfoRequest) (*v1.GetAccountInfoReply, error) {
	return s.account.GetAccountInfo(ctx, req)
}

func (s *Account) UpdateAccountPassword(ctx context.Context, req *v1.UpdateAccountPasswordRequest) (*v1.UpdateAccountPasswordReply, error) {
	return s.account.UpdateAccountPassword(ctx, req)
}

func (s *Account) CreateRbacPermit(ctx context.Context, req *v1.CreateRbacPermitRequest) (*v1.CreateRbacPermitReply, error) {
	return s.account.CreateRbacPermit(ctx, req)
}

func (s *Account) DeleteRbacPermit(ctx context.Context, req *v1.DeleteRbacPermitRequest) (*v1.DeleteRbacPermitReply, error) {
	return s.account.DeleteRbacPermit(ctx, req)
}

func (s *Account) UpdateRbacPermit(ctx context.Context, req *v1.UpdateRbacPermitRequest) (*v1.UpdateRbacPermitReply, error) {
	return s.account.UpdateRbacPermit(ctx, req)
}

func (s *Account) ListsRbacPermit(ctx context.Context, req *v1.ListsRbacPermitRequest) (*v1.ListsRbacPermitReply, error) {
	return s.account.ListsRbacPermit(ctx, req)
}

func (s *Account) CreateRbacRole(ctx context.Context, req *v1.CreateRbacRoleRequest) (*v1.CreateRbacRoleReply, error) {
	return s.account.CreateRbacRole(ctx, req)
}

func (s *Account) DeleteRbacRole(ctx context.Context, req *v1.DeleteRbacRoleRequest) (*v1.DeleteRbacRoleReply, error) {
	return s.account.DeleteRbacRole(ctx, req)
}

func (s *Account) UpdateRbacRole(ctx context.Context, req *v1.UpdateRbacRoleRequest) (*v1.UpdateRbacRoleReply, error) {
	return s.account.UpdateRbacRole(ctx, req)
}

func (s *Account) ListsRbacRole(ctx context.Context, req *v1.ListsRbacRoleRequest) (*v1.ListsRbacRoleReply, error) {
	return s.account.ListsRbacRole(ctx, req)
}

func (s *Account) RbacUserList(ctx context.Context, req *v1.RbacUserListRequest) (*v1.RbacUserListReply, error) {
	return s.account.RbacUserList(ctx, req)
}

func (s *Account) RbacPermitList(ctx context.Context, req *v1.RbacPermitListRequest) (*v1.RbacPermitListReply, error) {
	return s.account.RbacPermitList(ctx, req)
}

func (s *Account) ListsUser(ctx context.Context, req *v1.ListsUserRequest) (*v1.ListsUserReply, error) {
	return s.account.ListsUser(ctx, req)
}

func (s *Account) UpdateUser(ctx context.Context, req *v1.UpdateUserRequest) (*v1.UpdateUserReply, error) {
	return s.account.UpdateUser(ctx, req)
}

func (s *Account) DeleteUser(ctx context.Context, req *v1.DeleteUserRequest) (*v1.DeleteUserReply, error) {
	return s.account.DeleteUser(ctx, req)
}

func (s *Account) CreateSystemNotice(ctx context.Context, req *v1.CreateSystemNoticeRequest) (*v1.Response, error) {
	return s.account.CreateSystemNotice(ctx, req)
}

func (s *Account) DeleteSystemNotice(ctx context.Context, req *v1.DeleteSystemNoticeRequest) (*v1.Response, error) {
	return s.account.DeleteSystemNotice(ctx, req)
}

func (s *Account) UpdateSystemNotice(ctx context.Context, req *v1.UpdateSystemNoticeRequest) (*v1.Response, error) {
	return s.account.UpdateSystemNotice(ctx, req)
}

func (s *Account) SelectSystemNotice(ctx context.Context, req *v1.SelectSystemNoticeRequest) (*v1.SelectSystemNoticeReply, error) {
	return s.account.SelectSystemNotice(ctx, req)
}

func (s *Account) UserMessageUnread(ctx context.Context, req *v1.UserMessageUnreadRequest) (*v1.UserMessageUnreadReply, error) {
	return s.account.UserMessageUnread(ctx, req)
}

func (s *Account) UserMessageLists(ctx context.Context, req *v1.UserMessageListsRequest) (*v1.UserMessageListsReply, error) {
	return s.account.UserMessageLists(ctx, req)
}

func (s *Account) UserMessageRead(ctx context.Context, req *v1.UserMessageReadRequest) (*v1.UserMessageReadReply, error) {
	return s.account.UserMessageRead(ctx, req)
}

func (s *Account) ListsReader(ctx context.Context, req *v1.ListsReaderRequest) (*v1.ListsReaderReply, error) {
	return s.account.ListsReader(ctx, req)
}

func (s *Account) UpdateReader(ctx context.Context, req *v1.UpdateReaderRequest) (*v1.UpdateReaderReply, error) {
	return s.account.UpdateReader(ctx, req)
}

func (s *Account) ReaderList(ctx context.Context, req *v1.ReaderListRequest) (*v1.ReaderListReply, error) {
	return s.account.ReaderList(ctx, req)
}

func (s *Account) ApproveSourcesLists(ctx context.Context, req *v1.ApproveSourcesListsRequest) (*v1.ApproveSourcesListsReply, error) {
	return s.account.ApproveSourcesLists(ctx, req)
}

func (s *Account) ApproveSourcesUpdate(ctx context.Context, req *v1.ApproveSourcesUpdateRequest) (*v1.ApproveSourcesUpdateReply, error) {
	return s.account.ApproveSourcesUpdate(ctx, req)
}

func (s *Account) ApproveSourcesUpdateReader(ctx context.Context, req *v1.ApproveSourcesUpdateReaderRequest) (*v1.ApproveSourcesUpdateReaderReply, error) {
	return s.account.ApproveSourcesUpdateReader(ctx, req)
}

func (s *Account) ApproveSourcesItems(ctx context.Context, req *v1.ApproveSourcesItemsRequest) (*v1.ApproveSourcesItemsReply, error) {
	return s.account.ApproveSourcesItems(ctx, req)
}

func (s *Account) ApproveSourcesAll(ctx context.Context, req *v1.ApproveSourcesAllRequest) (*v1.ApproveSourcesAllReply, error) {
	return s.account.ApproveSourcesAll(ctx, req)
}
